package com.edu.bhu.admin.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.edu.bhu.admin.mapper.CosTypeMapper;
import com.edu.bhu.admin.domain.CosType;
import com.edu.bhu.admin.service.ICosTypeService;
import com.edu.bhu.common.core.text.Convert;

/**
 * 商品种类Service业务层处理
 * 
 * @author wangjinao
 * @date 2022-03-17
 */
@Service
public class CosTypeServiceImpl implements ICosTypeService 
{
    @Autowired
    private CosTypeMapper cosTypeMapper;

    /**
     * 查询商品种类
     * 
     * @param typeId 商品种类主键
     * @return 商品种类
     */
    @Override
    public CosType selectCosTypeByTypeId(Long typeId)
    {
        return cosTypeMapper.selectCosTypeByTypeId(typeId);
    }

    /**
     * 查询商品种类列表
     * 
     * @param cosType 商品种类
     * @return 商品种类
     */
    @Override
    public List<CosType> selectCosTypeList(CosType cosType)
    {
        return cosTypeMapper.selectCosTypeList(cosType);
    }

    /**
     * 新增商品种类
     * 
     * @param cosType 商品种类
     * @return 结果
     */
    @Override
    public int insertCosType(CosType cosType)
    {
        return cosTypeMapper.insertCosType(cosType);
    }

    /**
     * 修改商品种类
     * 
     * @param cosType 商品种类
     * @return 结果
     */
    @Override
    public int updateCosType(CosType cosType)
    {
        return cosTypeMapper.updateCosType(cosType);
    }

    /**
     * 批量删除商品种类
     * 
     * @param typeIds 需要删除的商品种类主键
     * @return 结果
     */
    @Override
    public int deleteCosTypeByTypeIds(String typeIds)
    {
        return cosTypeMapper.deleteCosTypeByTypeIds(Convert.toStrArray(typeIds));
    }

    /**
     * 删除商品种类信息
     * 
     * @param typeId 商品种类主键
     * @return 结果
     */
    @Override
    public int deleteCosTypeByTypeId(Long typeId)
    {
        return cosTypeMapper.deleteCosTypeByTypeId(typeId);
    }
}
